|
If you are upgrading from Music Object version 2.x and would like to know about the significant changes that have occurred between versions 2.x and 3.0.x, please consult the version history for Music Object Version 3.0.0.
| Music Object API Changes |
Beatnik is possibly the first company to have produced a fully functional and fully scriptable plug-in for the Netscape 6 browser that is also fully compatible with the player available for the Netscape Navigator 4.x and Microsoft Internet Explorer browsers. Thanks to the tireless efforts of the Beatnik engineering and QA teams, versions 2.1 and higher of the Beatnik Player provide the full Beatnik experience to user of Netscape 6.
Much work has gone into adapting the Beatnik Player to utilize the XPCOM plug-in architecture used in Netscape 6, and many contributions have been made to the Mozilla open source initiative. Furthermore, changes have been made to Music Object 3.3.0 specifically to make it work better with Netscape 6, including adding a mechanism to assist the new Audio Device Contention Manager.
Perhaps one of the greatest new things about Netscape 6 that significantly benefits Beatnik content is the fact that the Java language is no longer used as the connection layer between JavaScript and the plug-in. As a result, Beatnik content in Netscape will never again force the user to endure the annoying delay of Java starting up, Beatnik content will no longer be at the mercy of whether or not the user has Java enabled in their browser, and Beatnik content may be a little bit zippier and even more stable than ever.
Not everything is rosy with Netscape 6, however, and there are some issues to be aware of. Specifically, the initial release of Netscape 6 contains a rather insidious bug affecting the sonification of HTML elements (such as links and forms) using the Wizards extension or other custom automatic sonification code. This bug also impacts the Auto Disengage extension. For more information on this issue, consult the section Netscape 6 and Automatic Sonification.
On some Windows systems, limitations in the installed sound hardware, the software drivers for the sound hardware, or the operating system's audio architecture may result in a situation where the Beatnik Player cannot play audio at the same time as other media players that wish to play audio. Typically, with these systems only one application can use the system's audio services at a time, often leading to situations where two (or more) applications are contending for this single audio device that cannot be shared by multiple applications simultaneously.
With the Beatnik Player version 2.1, a system was put in place to manage this problem and help to avoid situations where the use of the Beatnik Player in sonifying a Web site could interfere with some users' ability to experience audio or audiovisual content through other media players (such as Microsoft's Windows Media Player, Real Networks' RealPlayer, nullsoft's Winamp, Liquid Audio's Liquid Player, and others) - situations which could otherwise lead to technical support queries for the manager or developer of the Web site and which could potentially damage the reputation of the site.
Several new static methods and static properties have been introduced for Music Object 3.3 to allow the behavior of this system to be customized to suit the needs of specific sonified content. For a better understanding of this system, consult the section Audio Device Contention Manager.
Thanks to a code-scrunching process that was developed by Beatnik, all of the Music Object API's JavaScript files are now on average 30% smaller. This includes the core Music Object API and all of its extensions, patches, and language modules. This translates to quicker download time for sonified pages. Also, because the scrunching process has resulted in many variable and function names becoming shorter, there should be a slight performance improvement for sonified pages, since long identifier names can result in the JavaScript interpreter using more memory resources as well as using more CPU processing time.
Finally, hidden player instances that are created using the stubEmbed method (and also by the magicEmbed method when "WIDTH=0 HEIGHT=0 HIDDEN" is specified) are truly hidden on the page and do not occupy any layout space. That means no more annoying 2x2 pixel dots in Microsoft Internet Explorer, and no more critical graphical layouts being misaligned because of hidden player instances.
Music Object 3.3 provides broader support for customized versions of the Netscape Communicator browser, including versions that are shipped with some brands of laptop computers and versions that are customized by certain Internet Service Providers (ISPs), such as @Home, Earthlink, and others. Some problems in previous Music Object versions, that prevented some customized versions of Netscape Navigator from being recognized as supported, have been fixed.
According to the latest revision of the ECMA-262 standard (JavaScript, JScript, etc.), the "with" statement has been deprecated. While it may be supported for some browser versions in the future in order to maintain backwards compatibility with existing content, there is some question as to how consistent the implementation of the statement will be across all browsers that support ECMA-262, given that the statement will no longer be part of the official language specification.
Even though testing indicated that a pre-release version of Netscape 6 was generally still supporting the "with" statement, some specific problems were encountered when using the "with" statement with the window.location object. Because of these problems, it was decided to play it safe rather to risk later on discovering further incompatibilities between the way that different browsers handle the "with" statement. Because the "with" statement has been deprecated from the JavaScript language, there is no level of quality of ongoing support that can be expected for the "with" statement. If bugs were to be found, for instance, fixing such issues may not receive a high priority since the statement is deprecated.
So, an effort has been made with the release of Music Object 3.3 to remove all "with" statements from all JavaScript code, including the core Music Object API and all of its extensions, language modules, and patches.
The stubEmbed method has been extended to now accept an optional additional parameter to allow the embedding properties to be further customized, in a similar manner as the preloadEmbed method. This makes the stubEmbed method a lot more flexible.
The new custom volume scalar mechanism allows you to create multiple levels of volume control for each Music Object instance. Any number of custom scalars can be created, allowing each instance to have multiple volume controls, all of which cooperate together to produce an overall output volume for an instance. This opens up a whole new array of possibilities for Music Object instance groupings. For more information, consult the section Important Concepts: Custom Volume Scalars.
The new onOutputVolumeChange callback allows you to register a handler that will get executed each time there is a change in a Music Object instance's output volume. At the time that the handler for this callback is executed, the actual output volume can be accessed using the new getOutputVolume instance method. For more information, consult the sections Important Concepts: Callbacks and Important Concepts: Custom Volume Scalars.
The new FILEVOLUMESCALING embedding property lets you specify whether a file's internal volume setting should be scaled against the player volume, or simply be ignored. For a better understanding of file volume scaling, consult the section Important Concepts: File Volume Scaling.
The new addCallbackHandler method provides a generic way to register handlers for any of the Music Object API's callback types. Because the callback type is specified by a string parameter, this method makes it easy to conditionalize to which callback a handler should be added, simply by using a string expression to specify the callback type. This method also makes it possible to register multiple handlers for a single callback type - a feature which, up until now, has only been available when using the Callbacks extension.
Because the new custom volume scalar mechanism allows an arbitrary number of volume scalars to be created for each Music Object instance, the new getOutputVolume instance method has been provided to allow you to find the actual output volume that results from the settings of an instance's various volume scalars. For reasons of backward compatibility, the getVolume method still behaves in the same manner, and returns the volume set by the setVolume method and the VOLUME embedding property.
The new onAudibleStateChange instance method lets you to register a handler that will get executed each time there is a change in a Music Object instance's audible state, between being audible and being inaudible. At the time that the handler for this callback is executed, the actual audible state can be accessed using the new aubible instance property, so the handler can conditionalize its implementation appropriately. For more information, consult the section Important Concepts: Callbacks.
The onOutputVolumeChange instance method lets you register JavaScript code that is to be executed each time there is a change in the Music Object instance's output volume. At the time that the handler for this callback is executed, the current output volume can be obtained using the new getOutputVolume instance method. For more information, consult the section Important Concepts: Callbacks.
The new audible instance property is a boolean variable, indicating whether or not a Music Object instance is audible. This property can be used in conjunction with the new onAudibleStateChange callback, allowing the implementation of this callback's handler to be conditionalized based upon the audible state of the instance.
The new averageNoteRelease instance property is an integer variable, representing the average release time (measured in milliseconds) for notes being played through a Music Object instance. This property is typically used to customize the behavior of the Auto Disengage extension and the Ducking extension.
The new usage instance property is a string variable, representing the intended usage for the Music Object instance ('notes' or 'music'). Setting this property allows you to control how an instance should behave when the Ducking extension is being used and when the instance is acting as a ducking master. The value set for this property also affects the behavior of the audible instance property and the onAudibleStateChange callback.
The new Music.clientKnown read only static property is a boolean variable, indicating whether or not the user's client (browser) is known by Music Object.
The new Music.clientName read only static property is a string variable, indicating the name of the user's client application (or browser).
The new Music.clientUpgradable read only static property is a boolean variable, indicating whether or not the player can be installed in the user's client application (or browser).
The new Music.clientVersion read only static property is a string variable, indicating the version of the user's client application (or browser).
The new Music.embedDefaults static property is an array, representing the default values for all of the Beatnik Player's supported embedding properties. This property provides a convenient way to set up default values for certain embedding properties so as to avoid having to specify the exact same values many times over in multiple calls to the magicEmbed instance method (or other embedding methods).
The new Music.version read only static property is a string variable, indicating the version of the Music Object API that is being used.
The new Music.addCallbackHandler static method lets you add a callback handler to the stack of callback handlers for a specified static callback.
The new Music.getAudioDevicePriority static method returns an integer value, indicating the current audio device priority setting for the sonified document. This method forms part of the new Audio Device Contention Manager that is built into player versions 2.1 and higher, and can be used as part of a system for managing and monitoring the engaged state behavior of the player's underlying audio engine.
The new Music.isAudioEngaged static method returns a boolean indicating whether or not the player's underlying audio engine is engaged. One common way to use this method is in a handler for the onAudioEngagedChange static callback, or as part of a system for managing and monitoring the engaged state behavior of the player's underlying audio engine.
The new Music.isAudioDeviceShared static method returns a boolean value, indicating whether or not the Beatnik Player can share the system's audio device with other media players. This method forms part of the new Audio Device Contention Manager that is built into player versions 2.1 and higher, and can be used as part of a system for managing and monitoring the engaged state behavior of the player's underlying audio engine.
The new Music.isAudioSupported static method returns a boolean value, indicating whether or not the user's system provides audio services that are compatible with the player. Certain types of sonified content may rely so heavily upon the audio features of the Beatnik Player that it may not be worth letting users experience the content if their system has no audio support. This method provides a helpful way of preempting technical support e-mails and phone calls that might otherwise result if users were allowed to enter sonified content and then not hear any audio because their systems did not have support for audio.
The new Music.onAudioEngagedChange static method lets you register JavaScript code that is to be executed each time there is a change in the engaged state of the player's underlying audio engine. This method can be used as part of a system for managing and monitoring the engaged state behavior of the player's underlying audio engine.
The new Music.onEngageAudio static method lets you register JavaScript code that is to be executed after each call to the Music.engageAudio static method. Registering a handler for the onEngageAudio callback can be a convenient way to monitor the activity of the Auto Disengage extension.
The new Music.requireMinPlayerVersion static method allows separate code modules to independently request a minimum player version, such that the highest minimum player version that is requested by all code modules will be the version used to determine if the player installed on the user's system is adequate for the content as a whole.
The new Music.setAudioDevicePriority static method lets you set the audio device priority for a sonified document. This method forms part of the new Audio Device Contention Manager that is built into player versions 2.1 and higher, and can be used as part of a system for managing and monitoring the engaged state behavior of the player's underlying audio engine.
For the release of Music Object 3.3 and the Beatnik Player 2.1, Beatnik had to take a fresh (and sobering) look at its browser support matrix in order to prioritize the allocation of QA resources. Sadly, the amount of QA resources that would be required in order to maintain some level of support for Navigator 3.x would not be well spent, with very small anticipated gains. Instead, effort has been focused on Navigator 4.x browsers, Microsoft Internet Explorer, and the freshly released Netscape 6.It is not only because of QA resource constraints, however, that support for Navigator 3.x has been dropped. For some time now, the newer browser versions have been introducing compelling new JavaScript language features, and maintaining support for Navigator 3.x has exerted somewhat of a stranglehold on the adoption of these new features that could otherwise help to make the Music Object API a more powerful platform for interactive audio and music. With the shackles of Navigator 3.x finally cast aside, Beatnik is now free to explore new options for this already strong authoring platform.
So, take a moment to say a fond farewell to a browser that was once a pioneer of its time. Navigator 3.x support is no more, and ultimately all those who develop content using the Music Object API will benefit from this progressive decision.
The Music.requiredMinVersion static property has now become a read-only property and should no longer be set explicitly. For code that is dependent on the features of a particular player version, the new Music.requireMinPlayerVersion static method should be used instead.
For the release of Music Object 3.3, it was decided that all static properties that indicated information about the user's client application (or browser) should be grouped together by naming convention, by prefixing each of these properties with "client" (eg. Music.clientName, Music.clientSupported, Music.clientVersion). Consequently, the Music.platform static property has been replaced by the functionally equivalent Music.clientPlatform static property.
The new Auto Disengage extension provides features to help alleviate the conflicts that may occur in some system configurations when the Beatnik Player and other audio players are being used together in the same Web site. Along with the ability to have the Beatnik Player automatically release the system's WAV device when the player is not in use by the sonified site, the extension also provides a way to automatically force the player to release the WAV device when the user clicks on a link to any type of audio file that is not supported by the Beatnik Player (such as a streaming Real Audio file).
The new Channels extension provides convenient access to all the channel properties that can be controlled through the Music Object API. Most of these properties can be accessed using the core Music Object API's setController and getController methods, so this extension is provided primarily to ease programming and to make sonification code more easily understood. As an example, using the Channels extension's setChannelReverbLevel method has the same effect as using the setController method and specifying the value 91 for the ControllerNumber0to127 parameter.
The new Clip extension provides a set of services for conveniently creating a music preview system on a Web page.
The new Ducking extension provides methods for linking instances to one another and setting up automated ducking relationships - much like the ducking effect used so often in radio broadcasting.
The new Group Volume extension provides methods for adjusting the overall volume of an entire group of Music Object instances. This, for example, makes it really easy for the overall group volume levels of all Music Object instances that are being used for one functional aspect of a page's sonification (such as user interface sound effects or background music) to be adjusted in one simple step, without interfering with the different instances' individual volume levels that are being used to balance the instances together in the group. In particular, this extension offers the Music.setPageVolume and Music.getPageVolume static methods that make it possible to modify the overall volume of a page's sonification in one operation.
The new Note Effects extension provides methods for easily creating outrageous sound effects using just musical notes. For example, the playNoteSlide method provides a convenient way to generate musical note "slides", often referred to by musicians as glissandos. Using this method, you can instantly and easily achieve a wide variety of complex sound textures and outrageous effects.
The new Snapshots extension provides methods for easily capturing and restoring mix snapshots for RMF and MIDI files that are playing - something that can prove quite useful when creating certain kinds of remixing applications.
The new Song Info extension provides you with further options for displaying an RMF file's copyright information.
The new Tracing extension provides an easy way to watch calls to methods of the Music Object API and is a very useful tool to have when debugging sonification code. The extension offers a set of methods that can be used to control exactly which methods of the Music Object API are to be "watched". When a method is being watched, each call to the method will be displayed in the tracing window (either the Java console or a pop-up browser window), complete with the parameter values that are being passed.
| Documentation Changes |
The Putting Music On a Page tutorial now offers the new Embedding Groovoids step, which describes the simplest way to use Groovoids to play background music on a Web page.
The Randomizing Music On a Web Page tutorial has been enhanced to now include the new Cool File of the Day step, which explains how to dynamically rotate through a playlist of music files on a daily basis, so that a Web page plays a different file each day.
The playNoteSlide instance method, offered as part of the new Note Effects extension, provides a convenient and easy way to achieve a wide variety of complex sound textures and outrageous effects. The demo for this method provides a lot of basic note slide examples to get you started, as well as showing off some sophisticated techniques that can be used to achieve more complex stereo slide effects. The demo also includes a nifty method editor, so that you can tweak the parameters of the playNoteSlide method to your heart's content.
Starting from version 3.1, the Music Object API has offered additional functionality in the form of optional Music Object extensions. Up until now, however, the API (Application Programming Interface) for writing these extensions has been private. For the first time, with version 3.3, this API is official, public, and documented. The new Music Object Extensibility API section explains the architecture upon which Music Object extensions, language modules, and patches are based and includes a reference to all the methods and properties of the extensibility API.
Many versions of the Music Object API have come and gone, and some significant changes in the API have occurred, leaving a good number of features either deprecated or completely unsupported in version 3.3. In previous versions of the documentation, features that had become unsupported were no longer listed in either the index or the reference sections. However, because this can cause difficulties for developers who are updating old sonification code to use the most current version of the Music Object API, the dedicated new Obsoleted Features section has been added. This section lists all methods, properties, global functions, and global variables that have become unsupported, with explanations on how such features behaved and how newer features of the Music Object API can be used to achieve similar results.
The Introduction to Music Object section of the documentation has been enhanced to include the new subsections, "Methods and Properties" and "File Types and Functionality". The Methods and Properties subsection explains the relationships between static and instance methods, and between static and instance properties. The File Types and Functionality subsection explains how the various methods and properties of the Music Object API relate to the various different music and audio file types that are supported.
The Embedding Properties section has been enhanced with better layout, more up-to-date information, and improved explanations. In addition, the reference information for each embedding property now has a reference data sheet, bringing this section in line with other sections of the documentation. For each embedding property, the reference data sheet indicates if the property can be used as an EMBED tag attribute, an OBJECT tag attribute, an OBJECT tag PARAM, and a magicEmbed property.
Channels or tracks can be active or inactive depending on their mute state, their solo state, and the solo states of all other channels or tracks. The section Mute and Solo, and How They Interact with Each Other has been improved to now offer guidelines for determining if channels or tracks are active. Sample code is also provided.
The reference information for each parameter in the Common Parameters section now has a reference data sheet, bringing this section in line with other sections of the documentation. For all integer parameters, an entry in the reference data sheet indicates whether or not the parameter's value is constrained. And for all string parameters that have finite lists of possible values, these values are listed in the data sheet.
Because the "with" statement has been deprecated from the JavaScript language (according to the latest revision of the ECMA-262 standard), an effort has been made with the release of Music Object 3.3 to remove all "with" statements from the documentation - including all tutorials, demos, sample code examples, tips and techniques sections, and all sample code segments in the various reference sections.
For convenience and ease of understanding of the documentation, some new items (such as "API", "PPQ", and others) have been added to the glossary.